<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace App\Controller\Api;

use App\Controller\AbstractController;
use App\Model\WebConfig;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;

#[Controller]
class WebConfigController extends AbstractController
{
    #[GetMapping(path: '/api/webConfig')]
    public function webConfig()
    {
        $webConfigs = WebConfig::query()
            ->select('id', 'name', 'logo', 'summary', 'record_num as recordNum', 'web_url as webUrl', 'author', 'author_info as authorInfo', 'author_avatar as authorAvatar', 'ali_pay as aliPay', 'weixin_pay as weixinPay', 'github', 'gitee', 'qq_number as qqNumber', 'qq_group as qqGroup', 'email', 'wechat', 'show_list as showList', 'login_type_list as loginTypeList', 'open_comment as openComment', 'open_admiration as openAdmiration', 'tourist_avatar as touristAvatar', 'bulletin', 'about_me as aboutMe', 'create_time as createTime', 'update_time as updateTime', 'open_lantern as openLantern')
            ->first();
        $extra = [
            'visitorCount' => 100,
            'blogViewsCount' => 1050,
        ];
        return success($webConfigs, $extra);
    }
}
